<input id="contractID" type="hidden" value="{{params._id}}">
<input id="version" type="hidden" value="{{params.version}}">
<input id="ids" type="hidden" value="{{params.ids}}">
<ul class="nav nav-tabs" id="myTab">
	<li class="active">
		<a data-toggle="tab" href="#info"> <i class="green  icon-info-sign bigger-110"></i>
			合同列表
		</a>
	</li>
	<li class="">
		<a data-toggle="tab" href="#caigouneirong"> <i class="blue icon-tasks bigger-110"></i>
			采购内容
		</a>
	</li>
	<li class="">
		<a id="tab-attachments" data-toggle="tab" href="#attachments"> <i class="blue icon-download-alt bigger-110"></i>
			附件列表
		</a>
	</li>

	<li class="">
		<a id="tab-price" data-toggle="tab" href="#tab-content-price">
			<i class="red icon-bookmark bigger-110"></i>
			回款计划
		</a>
	</li>

	<li class="">
		<a id="tab-history" data-toggle="tab" href="#tab-content-history">
			<i class="grey icon-share-alt  bigger-110"></i>
			历史版本
		</a>
	</li>
</ul>
<div class="tab-content">
	<div id="info" class="tab-pane active">
		<form id="validateForm">
			<div class="widget-box transparent">
				<div class="widget-header">
					<h3 class="smaller lighter green">合同基本信息</h3>
					<div class="widget-toolbar no-border">
						<div id="use-template-btn-group" class="btn-group">
							<button id="templateBtn" data-toggle="dropdown" class="btn btn-small btn-info dropdown-toggle">
								使用模板
								<i class="icon-angle-down icon-on-right"></i>
							</button>

							<ul id="templateList" class="dropdown-menu pull-right"></ul>
						</div>
					</div>
				</div>
			</div>
			<div class="contract-form form-horizontal row-fluid">
				<div class="span6">
					<div class="control-group ">
						<div class=" title_left">采购编号</div>
						<div class="controls">
							<input id="myId" name="myId" type="text"  class="span10" placeholder="合同编号"></div>
					</div>
					<div class="control-group ">
						<div class=" title_left">甲方</div>
						<div class="controls">
							<!-- <select id="partyA" name="partyA" class="span7"></select> -->
							<input type="text" id="partyA1" name="partyA" class="span7"></select>
							<input id="partyAabbr" name="partyAabbr" type="text"  class="span3" placeholder="简称" readonly style="margin-left:2px"></div>

					</div>
					<div class="control-group ">
						<div class=" title_left">甲方部门</div>
						<div class="controls">
							<input id="partyADept" name="partyADept" type="text"  class="span10" placeholder="部门"></div>

					</div>
					<div class="control-group ">
						<div class=" title_left">签订日期</div>
						<div class="controls">
							<input name="signPicker" class="date-picker span10" id="signPicker" type="text" data-date-format="yyyy-mm-dd" readonly="true"></div>
					</div>

					<div class="control-group">
						<div class=" title_left">结束日期</div>
						<div class="controls">
							<input name="endPicker" class="date-picker span10" id="endPicker" type="text" data-date-format="yyyy-mm-dd" readonly="true"></div>
					</div>

					<div class="control-group">
						<div class=" title_left">销售负责人</div>
						<div class="controls">
							<select name="sals_person" id="sals_person" class="span10">
								<option value="">--请选择--</option>
								<option  value="wangyonghe">王永和</option>
								<option  value="pangnasha">庞娜莎</option>
								<option  value="lijie">李杰</option>
							</select>
						</div>
					</div>
					<div class="control-group">
						<div class=" title_left">合同录入人</div>
						<div class="controls">
							<select name="contract_person" id="contract_person" class="span10">
								<option  value="">--请选择--</option>
							</select>
						</div>
					</div>
					<div class="control-group">
						<div class=" title_left">状态</div>
						<div class="controls">
							<input id="state"  type="text"  class="controls item_state span10">
						</div>
					</div>

				</div>

				<div class="span6">
					<div class="control-group">
						<div class=" title_right">合同名称</div>
						<div class="controls">
							<input id="name" name="name" type="text"  class="span10" placeholder="合同名称"></div>
					</div>

					<div class="control-group">
						<div class=" title_right">乙方</div>
						<div class="controls">
							<input type="text" id="partyB1" name="partyB" class="span7" placeholder="乙方"></input>
							<input id="partyBabbr" name="partyBabbr" type="text"  class="span3" placeholder="简称" readonly style="margin-left:2px;"></div>
					</div>

					<div class="control-group ">
						<div class=" title_right">实施业绩归属部门</div>
						<div class="controls">
							<input id="partyBDept" name="partyBDept" type="text"  class="span10" placeholder="部门"></div>

					</div>

					<div class="control-group">
						<div class=" title_right">中标日期</div>
						<div class="controls">
							<input name="beginPicker" class="date-picker span10" id="beginPicker" type="text" data-date-format="yyyy-mm-dd" readonly="true"></div>
					</div>

					<div class="control-group">
						<div class=" title_right">金额</div>
						<div class="controls">
							<input id="amount" name="amount" type="text"  class="span10" placeholder="金额" onKeyUp="this.value=this.value.replace(/\D/g,'')"></div>
					</div>

					<div class="control-group">
						<div class=" title_right">商务负责人</div>
						<div class="controls">
							<select name="business_person" id="business_person" class="span10">
								<option name="00" value="">--请选择--</option>
								<option  value="wangyanxi">王妍茜</option>
							</select>
						</div>
					</div>

					<div class="control-group">
						<div class=" title_right">销售业绩归属部门</div>
						<div class="controls">
							<select name="contract_dept" id="contract_dept" class="span10">
								<option selected value="">--请选择--</option>
								<option name="11" value="北京总部">北京总部</option>
								<option name="22" value="广州分公司">广州分公司</option>
								<option name="33" value="深圳分公司">深圳分公司</option>
								<option name="33" value="北区">北区</option>
								<option name="33" value="南区">南区</option>
								<option name="33" value="航空事业部">航空事业部</option>
							</select>
						</div>
					</div>

				</div>

			</div>
		</form>

		<div class="widget-box transparent">
			<div class="widget-header">
				<h3 class="smaller lighter green">合同事件列表</h3>
				
				<!-- <input type="button" id="showEvents" name="showEvents" class="btn btn-small btn-info" value="显示合同事件列表" /> -->
				<button id="showEvents" name="showEvents" class="btn btn-small btn-info">显示合同事件列表
				</button>
				<div class="widget-toolbar no-border">
					<div id="add-event-btn-group" class="btn-group">
						<button data-toggle="dropdown" id="eventAddBtn" class="btn btn-small btn-info dropdown-toggle" style="height:32px;">
							<i class="icon-plus icon-on-left"></i>
							增加事件
							<i class="icon-angle-down icon-on-right"></i>
						</button>

						<ul class="dropdown-menu pull-right">
							<li id="customEventBtn">
								<a>自定义事件</a>
							</li>

							<li id="priceEventBtn">
								<a>回款事件</a>
							</li>
						</ul>
					</div>
				</div>
			</div>

		</div>
		<div id="events" style="display:none">
		<ul id="eventsList" class="sortable">
			<div id="blankWarn" class="alert alert-warning">请添加合同事件.</div>
		</ul>
		</div>
		<div class="row-fluid bottom-cmd">

			<button id="deleteContractBtn" class="btn btn-danger">删除合同</button>
			<button id="saveAsTemplateBtn" class="btn btn-primary">保存为模板</button>
			<button id="exportExcel" class="btn btn-warning">合同导出</button>
			<button id="saveBtn" class="btn btn-success " data-last="Finish">保存合同</button>
			<div id='bottom-cmd-right' class="pull-right span4">
				{{! <a id="backBtn" class="btn  btn-success  span4" href="javascript:history.go(-1)">上一个合同</a>
				<a id="nextBtn" class="btn  btn-success  span4" href="javascript:history.go(-1)">下一个合同</a>
				<a id="backBtn" class="btn  btn-success span4" href="javascript:history.go(-1)">返回</a> }}
			</div>
		</div>
	</div>
	<div id="caigouneirong" class="tab-pane">

		<div class='span12 widget-box'>
			<div class='widget-header widget-header-flat widget-header-small'>
				<div class='span5'>
					<span class='celltitle'>采购内容</span>
				</div>
				<div class='span3 widget-toolbar'>
					<span class='celltitle'>单价</span>
				</div>
				<div class='span3 widget-toolbar'>
					<span class='celltitle'>数量（人天）</span>
				</div>
				<div class='span1 widget-toolbar'>
					<button id="caigou_add"class='btn btn-mini bigger btn-info '>增行</button>
				</div>
			</div>
			<div id="caigou">
			</div>
		</div>
	</div>
	<div id="attachments" class="tab-pane">
		<ul class="files"></ul>
		<div class="file-list">
			<button id="file_upload">选择附件</button>
		</div>
	</div>

	<div id="tab-content-price" class="tab-pane"></div>

	<div id="tab-content-history" class="tab-pane">
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th class="center">记录日期</th>
					<th class="center">版本号</th>
				</tr>
			</thead>
			<tbody id="histroy-list"></tbody>
		</table>
	</div>
</div>